#!/bin/bash

echo "Testing Bamboo Scheme Interpreter..."
echo

# Test 1: Display string literal
echo "Test 1: Display string literal"
echo '(display "hello world")' | go run main.go
echo

# Test 2: Define and display variable
echo "Test 2: Define and display variable"
echo -e '(define s "hello world")\n(display s)' | go run main.go
echo

# Test 3: Multiple defines
echo "Test 3: Multiple defines"
echo -e '(define a "foo")\n(define b "bar")\n(display a)\n(display b)' | go run main.go
echo

# Test 4: Integer literal
echo "Test 4: Integer literal"
echo '42' | go run main.go
echo

# Test 5: Negative integer
echo "Test 5: Negative integer"
echo '-123' | go run main.go
echo

# Test 6: Simple arithmetic - addition
echo "Test 6: Simple arithmetic - addition"
echo '(+ 1 2 3)' | go run main.go
echo

# Test 7: Simple arithmetic - subtraction
echo "Test 7: Simple arithmetic - subtraction"
echo '(- 10 3)' | go run main.go
echo

# Test 8: Simple arithmetic - multiplication
echo "Test 8: Simple arithmetic - multiplication"
echo '(* 4 5)' | go run main.go
echo

# Test 9: Simple arithmetic - division
echo "Test 9: Simple arithmetic - division"
echo '(/ 20 4)' | go run main.go
echo

# Test 10: Nested arithmetic expressions
echo "Test 10: Nested arithmetic expressions"
echo '(+ (* 2 3) (- 10 4))' | go run main.go
echo

# Test 11: Arithmetic with variables
echo "Test 11: Arithmetic with variables"
echo -e '(define x 5)\n(define y 3)\n(+ (* x 2) y)' | go run main.go
echo

# Test 12: Multi-line input - simple
echo "Test 12: Multi-line input - simple"
echo -e '(+ 1\n2 3 4)' | go run main.go
echo

# Test 13: Multi-line input - nested
echo "Test 13: Multi-line input - nested"
echo -e '(* (+ 1\n2)\n(- 5\n3))' | go run main.go
echo

echo "All tests completed!"